<?php
class widget_menu extends CWidget {
  public function run() {
    $categories   = Category::model()->getCategories();
    $product_menu = (!empty($categories)) ? 'hasSubmenu' : ''; 
    
    $this->render('widget_menu', array(
      'categories' => $categories, 'product_menu' => $product_menu
    ));
  }
}
?>